package com.cedric.yixianpai.game.cards.Sects.swordCards.d_YuanYing;

import com.cedric.yixianpai.game.Constants.CardType;
import com.cedric.yixianpai.game.Constants.Period;
import com.cedric.yixianpai.game.Status.DuelStatus;
import com.cedric.yixianpai.game.interfaces.SwordCard;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class JuKunLingJian extends SwordCard {
    /**
     * title:巨鲲灵剑
     * effect:SE-3 10/13/16攻 10/13/16防 再动
     */
    public JuKunLingJian(@Value("1") int lvl) {
        super("巨鲲灵剑");
        this.setLevel(lvl);
        this.setPeriod(Period.YUANYING);
        this.setDescription("灵气-3 10/13/16攻 10/13/16防 再次行动");
        this.setCardType(CardType.LING);

        this.setSpiritNeed(3);
        if (1 == lvl) {
            this.setDamage(10);
            this.setShield(10);
        } else if (2 == lvl) {
            this.setDamage(13);
            this.setShield(13);
        } else if (3 == lvl) {
            this.setDamage(16);
            this.setShield(16);
        } else {
            throw new RuntimeException("Card Level Error!");
        }
    }

    @Override
    public boolean effect(DuelStatus Sta1, DuelStatus Sta2) {
        if(Sta1.spiritEnough(this.getSpiritNeed())){
            Sta1.attack(Sta2,this.getDamage());
            Sta1.getPlayerBuff().clearSwordIntent();
            Sta1.getPlayerBuff().addShield(this.getShield());
            Sta1.setAgain();
            return true;
        }
        return false;
    }
}
